home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
401_500
/
DISK0437
/
DISK0437.ZIP
/
COILINDU.BAS
next >
Wrap
BASIC Source File
|
1985-06-14
|
768b
|
23 lines
10 'THIS PROGRAM CALCULATES THE LENGTH AND TOTAL NUMBER OF TURNS
20 'FOR A SINGLE LAYER AIR-CORE COIL. SEE RADIO HANDBOOK FOR TURNS-PER-INCH
30 'DATA FOR VARIOUS WIRE SIZES.
35 DEFDBL T,R'DEFINES VARIBLES STARTING WITH T OR R AS DOUBLE PRECISION
40 INPUT "INDUCTANCE IN MICROHENRYS ";H
50 INPUT "DIAMETER OF COIL ";D
60 INPUT "TURNS PER INCH ";TI
70 R=D/2
80 L=3 'FIRST TRIAL LENGTH
90 T=(H*((9*R)+(10*L))/R^2)^.5
100 LT=T/TI 'CALCULATES LENGTH BASED ON TURNS PER INCH
110 E=L-LT 'CALCULATE ERROR IN LENGTH
120 L=L-E 'RE-ESTIMATE LENGTH
130 IF ABS(E)<.01 GOTO 150
140 GOTO 90
150 PRINT
160 L=INT(L*100+.5)/100
170 PRINT "COIL LENGTH IS: ";L;"INCHES"
180 T1=L*TI
190 T1=INT(T1*10+.5)/10
200 PRINT "TOTAL NUMBER OF TURNS IS: ";T1
210 END
PRINT